<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <script src="__STATIC__/js/base.js"></script>
    <title>订单列表</title>
    <link rel="stylesheet" href="__STATIC__/css/base.css">
    <link rel="stylesheet" href="__STATIC__/css/orderlist.css">
    <script src="__STATIC__/js/jquery-1.11.1.min.js"></script>
    <link rel="stylesheet" href="__STATIC__/css/index.css">
</head>
<body>
<section class="wrap">
   <div id="content">
       <div class="order-list-title-fix" >
           <div class=" order-list-title clearfix">
               <div class="pull-left "><span class="active" id="all">全部</span></div>
               <div class="pull-left"><span id="unpay">待付款</span></div>
               <div class="pull-left"><span id="uncomment">待确认</span></div>
               <div class="pull-left"><span id="canceled">已取消</span></div>
               <div class="pull-left"><span  id="finished">已完成</span></div>
           </div>
           <div class="bar_20"></div>
       </div>
       <div class="order-list-info">
           <ul class="order-list-index">
               {volist name="list" id="v"}
               <!--未支付订单-->
               {if $v.paymentStatus == 0 && $v['serviceType'] !=4 && $v['orderStatus'] !=9}
               <!--未支付，等待支付-->
               <li class="order_status_unpay" id="{$v.serviceOrderId}">
                   <a href="orderInfo?serviceOrderId={$v.serviceOrderId}">
                       <div class="clearfix">
                           <span class="pull-left"><?php echo substr($v['serviceName'],0,90);?></span>
                           <span class="pull-right"><lable  class="order_status">待付款</lable></span>
                       </div>
                       <div class="clearfix">
                           <span class="pull-left">{$v.cityName}{$v.districtName}</span>
                           <span class="pull-left ">¥{$v.orderAmount}</span>
                           <span class="pull-left">x1</span>
                       </div>
                       <div>
                           <div class="clearfix">
                               <span class="pull-left"><lable class="color_999">优惠：</lable>{$v.orderAmount-$v.payAmount}元</span>
                               <span class="pull-right"><lable class="color_999">实付：</lable>{$v.payAmount}元</span>
                           </div>
                       </div>
                   </a>
                   <div class="clearfix order_status_change">
                       <label class="pull-right active pay">立即支付</label>
                       <label class="pull-right do-cancle" >取消订单</label>
                   </div>
                   <div class="bar_40" style="padding-bottom: 0;border-bottom: 0;margin-top: 0.40333333rem"></div>
               </li>
               {/if}
               {/volist}
               {volist name="list" id="v"}
               <!--未支付订单-->
               {if $v.paymentStatus == 1 && $v.orderStatus==11}
               <li class="order_status_uncomment"  id="{$v.serviceOrderId}">
                   <a href="orderInfo?serviceOrderId={$v.serviceOrderId}">
                       <div class="clearfix">
                           <span class="pull-left"><?php echo substr($v['serviceName'],0,90);?></span>
                           <span class="pull-right"><lable  class="order_status">待确认</lable></span>
                       </div>
                       <div class="clearfix">
                           <span class="pull-left">{$v.cityName}{$v.districtName}</span>
                           <span class="pull-left ">¥{$v.orderAmount}</span>
                           <span class="pull-left">x1</span>
                       </div>
                       <div>
                           <div class="clearfix">
                               <span class="pull-left"><lable class="color_999">优惠：</lable>{$v.orderAmount-$v.payAmount}元</span>
                               <span class="pull-right"><lable class="color_999">实付：</lable>{$v.payAmount}元</span>
                           </div>
                       </div>
                   </a>
                   <div class="clearfix order_status_change">
                       <label class="pull-right active  do-confirm">订单完成</label>
                       <label class="pull-right ">申请售后</label>
                   </div>

                   <div class="bar_40" style="padding-bottom: 0;border-bottom: 0;;margin-top: 0.40333333rem"></div>
               </li>
               {/if}
               {/volist}
               {volist name="list" id="v"}
               {if $v.paymentStatus == 1}
               {if $v.orderStatus==7 }
               <li class="order_status_finished"  id="{$v.serviceOrderId}">
                   {if $v['serviceType']==4}
                   <a href="/guquanDetail_full?projectId={$v.serviceId}.html">
                       {else /}
                       <a href="orderInfo?serviceOrderId={$v.serviceOrderId}">

                       {/if}
                       <div class="clearfix">
                           <span class="pull-left"><?php echo substr($v['serviceName'],0,90);?></span>
                           <span class="pull-right"><lable  class="order_status">订单完成</lable></span>
                       </div>
                       <div class="clearfix">
                           <span class="pull-left">{$v.cityName}{$v.districtName}</span>
                           <span class="pull-left ">¥{$v.orderAmount}</span>
                           <span class="pull-left">x1</span>
                       </div>
                       <div>
                           <div class="clearfix">
                               <span class="pull-left"><lable class="color_999">优惠：</lable>{$v.orderAmount-$v.payAmount}元</span>
                               <span class="pull-right"><lable class="color_999">实付：</lable>{$v.payAmount}元</span>
                           </div>
                       </div>
                   </a>
                   <div class="clearfix order_status_change">
                       <label class="pull-right active  do-comment">立即评价</label>
                   </div>
                   <div class="bar_40" style="padding-bottom: 0;border-bottom: 0;;margin-top: 0.40333333rem"></div>
               </li>
               {/if}
               {if $v.orderStatus==8}
               <li class="order_status_finished"  id="{$v.serviceOrderId}">
                   <a href="orderInfo?serviceOrderId={$v.serviceOrderId}">
                           <div class="clearfix">
                               <span class="pull-left"><?php echo substr($v['serviceName'],0,90);?></span>
                               <span class="pull-right"><lable  class="order_status">订单完成，已评价</lable></span>
                           </div>
                           <div class="clearfix">
                               <span class="pull-left">{$v.cityName}{$v.districtName}</span>
                               <span class="pull-left ">¥{$v.orderAmount}</span>
                               <span class="pull-left">x1</span>
                           </div>
                           <div>
                               <div class="clearfix">
                                   <span class="pull-left"><lable class="color_999">优惠：</lable>{$v.orderAmount-$v.payAmount}元</span>
                                   <span class="pull-right"><lable class="color_999">实付：</lable>{$v.payAmount}元</span>
                               </div>
                           </div>
                       </a>
                       <div class="clearfix order_status_change">
                           {if $v['projectType'] ==8}
                           <label class="pull-right active buy-two" >再次购买</label>
                           {/if}
                       </div>
                       <div class="bar_40" style="padding-bottom: 0;border-bottom: 0;;margin-top: 0.40333333rem"></div>
               </li>
               {/if}
               {/if}
               {/volist}
               {volist name="list" id="v"}
               {if $v.paymentStatus == 0}
              <!--未支付订单-->
               {if $v.orderStatus==9 || $v.orderStatus==10 }
               <li class="order_status_canceled" id="{$v.serviceOrderId}">
                   <a href="orderInfo?serviceOrderId={$v.serviceOrderId}">
                       <div class="clearfix">
                           <span class="pull-left"><?php echo substr($v['serviceName'],0,90);?></span>
                           <span class="pull-right"><lable  class="order_status">
                               {if $v.orderStatus==9 }未付款，已取消{/if}
                               {if $v.orderStatus==10 }未付款，退单{else}{/if}</lable></span>
                       </div>
                       <div class="clearfix">
                           <span class="pull-left">{$v.cityName}{$v.districtName}</span>
                           <span class="pull-left ">¥{$v.orderAmount}</span>
                           <span class="pull-left">x1</span>
                       </div>
                       <div>
                           <div class="clearfix">
                               <span class="pull-left"><lable class="color_999">优惠：</lable>{$v.orderAmount-$v.payAmount}元</span>
                               <span class="pull-right"><lable class="color_999">实付：</lable>{$v.payAmount}元</span>
                           </div>
                       </div>
                   </a>
                   <div class="clearfix order_status_change">
                       <label class="pull-right active buy-two" >再次购买</label>
                   </div>
                   <div class="bar_40" style="padding-bottom: 0;border-bottom: 0;;margin-top: 0.40333333rem"></div>
               </li>
               {/if}
               {/if}
               {if $v.paymentStatus == 1}
               {if $v.orderStatus == 9 ||$v.orderStatus == 10 }
               <li class="order_status_canceled" id="{$v.serviceOrderId}">
                   <a href="orderInfo?serviceOrderId={$v.serviceOrderId}">
                       <div class="clearfix">
                           <span class="pull-left"><?php echo substr($v['serviceName'],0,90);?></span>
                           <span class="pull-right"><lable  class="order_status">
                               {if $v.orderStatus==9 }未付款，已取消{/if}
                               {if $v.orderStatus==10 }未付款，退单{else}{/if}</lable></span>
                       </div>
                       <div class="clearfix">
                           <span class="pull-left">{$v.cityName}{$v.districtName}</span>
                           <span class="pull-left ">¥{$v.orderAmount}</span>
                           <span class="pull-left">x1</span>
                       </div>
                       <div>
                           <div class="clearfix">
                               <span class="pull-left"><lable class="color_999">优惠：</lable>{$v.orderAmount-$v.payAmount}元</span>
                               <span class="pull-right"><lable class="color_999">实付：</lable>{$v.payAmount}元</span>
                           </div>
                       </div>
                   </a>
                   <div class="clearfix order_status_change">
                       <label class="pull-right active buy-two" >再次购买</label>
                   </div>
                   <div class="bar_40" style="padding-bottom: 0;border-bottom: 0;;margin-top: 0.40333333rem"></div>
               </li>
               {/if}
               {/if}
               {/volist}
           </ul>
           <script>
               $(function(){
                   $('.order_status_change label').on('click',function(){
                       $(this).parent().children().removeClass('active');
                       var id = $(this).parent().parent().attr('id');
                       $(this).addClass('active');
                       if( $(this).hasClass('do-comment')){
                           window.location.href='addComment.html';
                       }
                       if( $(this).hasClass('buy-two')){
                           window.location.href='goodsDetail?serviceId={$v.serviceId}';
                       }
                       if( $(this).hasClass('do-confirm')){
                           $.post("{:\\think\\Url::build('accomplish')}", {"id": id}, function (data) {
                               if (data.code == 'ok') {
                                   //连接不对
//                    var cancleUrl = "{:url('index/Order/list')}";
//                    var url = "{:url('index/Order/alert5')}";
                                   //layer_layer("",'{:\\think\\Url::build("index/User/successregister",["memberId"=>'+memberId+'])}',memberId);
                                   window.location.href = "/lists.html"
                               } else {
                                   layer.msg(data.msg, {
                                       icon: 2,
                                       time: 5000 //5秒关闭（如果不配置，默认是3秒）
                                   });
                               }

                           })
                       }
                       if( $(this).hasClass('do-cancle')){
                           $.post("{:\\think\\Url::build('cancellation')}", {id:id}, function (data) {
                               if (data.code == 'ok') {
                                   //连接不对
                                   window.location.href = "/lists.html"
//                            layer_layer(data.msg,"","");
                               } else {
                                   layer.msg(data.msg, {
                                       icon: 2,
                                       time: 5000 //5秒关闭（如果不配置，默认是3秒）
                                   });
                               }

                           })
                       }
                       if( $(this).hasClass('pay')){
                           window.location.href='/sendPay?serviceOrderId='+id;
                       }
                   });
                   var status =  getUrlParam('status');
                   if(status == 'unpay'){
                       $('.order-list-info .order_status_unpay').show();
                   }
                   if(status == 'unconfirm'){
                       $('.order-list-info .order_status_uncomment').show();
                   }
                   if(status == 'finished'){
                       $('.order-list-info .order_status_finished').show();
                   }
                   $('.order-list-title div span').on('click',function(){
                       $('.order-list-title div span').removeClass('active');
                       $(this).addClass('active');
                       var id = $(this).attr('id');
                       $('.order-list-info li').hide();
                       if(id == 'all'){
                           $('.order-list-info li').show();
                       }
                       if(id == 'unpay'){
                           $('.order-list-info .order_status_unpay').show();
                       }
                       if(id=='canceled'){
                           $('.order-list-info .order_status_canceled').show();
                       }
                       if(id == 'uncomment'){
                           $('.order-list-info .order_status_uncomment').show();
                       }
                       if(id == 'finished'){
                           $('.order-list-info .order_status_finished').show();
                       }
                   });
               });
           </script>
       </div>
       <!--<div class="foot" >-->
           <!--<div>企业宝</div>-->
           <!--<div>客服电话：400-123456</div>-->
       <!--</div>-->
   </div>
    <div class="padding" style="width: 100%;background:  #f6f4f4;"></div>
    <!--底部导航开始-->
    <div class="padding" style="width: 100%;background:  #f6f4f4;"></div>
    <!--底部导航开始-->
    <div class="floor-nav wrap-white">
        <a href="/index.html">
            <img src="__STATIC__/images/home.png" alt="" id="shouye">
            <span >首页</span>
        </a>
        <a href="/category.html">
            <img src="__STATIC__/images/catergry.png" alt="" id="cate">
            <span>分类</span>
        </a>
        <a href="/lists.html">
            <img src="__STATIC__/images/order.png" alt="" id="order">
            <span>订单</span>
        </a>
        <a href="/info.html">
            <img src="__STATIC__/images/me.png" alt="" id="my">
            <span>我的</span>
        </a>
    </div>
    <!--底部导航结束-->
    <script>
        $(function(){
            var url=window.location.href;
            //从订单确认面过来的则是选择收货地址，跳回订单确认页面
            var  index=new RegExp('index.html');
            var  order = new RegExp('lists.html');
            var  my = new RegExp('info.html');
            var  cate = new RegExp('category.html');
            if(index.test(url)){
                $('#shouye').attr('src','__STATIC__/images/home1.png');
                $('#shouye').parent().children('span').addClass('col-blue');
            };
            if(order.test(url)){
                $('#order').attr('src','__STATIC__/images/order1.png');
                $('#order').parent().children('span').addClass('col-blue');
            };
            if(cate.test(url)){
                $('#cate').attr('src','__STATIC__/images/catergry1.png');
                $('#cate').parent().children('span').addClass('col-blue');
            };
            if(my.test(url)){
                $('#my').attr('src','__STATIC__/images/me1.png');
                $('#my').parent().children('span').addClass('col-blue');
            };
        });


    </script>
</section>
<script>
    $(function(){
        var html = document.querySelector("html");
        var width = html.getBoundingClientRect().width;
        var fontSize = width/16;
        var height = window.innerHeight;
        var floorH = fontSize *3;
        var contentH = $('#content').height();
        if(contentH > (height - floorH)){
            $('.padding').height(floorH);
        }
    });

</script>
</body>
</html>